Fix: data type consistency and Wconv catch #238
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
*Issue number of the reported bug or feature request: #87 *
Describe your changes
This PR deals with some ‘size_t‘ and ‘int‘ data type inconsistencies. Between lines 400-437, I fixed the data types to ‘int‘ from ‘size_t‘ to keep consistent with the previous loops in the file.
This PR also catches with the following -Wconversion warnings that pollutes the build logs:
Testing performed
N/A
Additional context
An alternative naive fix to the logs would have been casting the first parameters in TestType as an ‘int‘ instead of making the changing the for loops to be of data type ‘int‘ instead of ‘size_t‘. However, k_STATIC_LEN is defined to be ‘const int ::k_STATIC_LEN = 10‘, and most of the for loops in the context use ‘int‘ if they aren't explicitly bounded by or referring to an obj size.
Note that lines 400-437 look hardcoded. Please comment to let me know if I should use or define a local ‘k_NB_ITEMS‘ or some other sort of constant(s) instead of having 50, 100, 150, 200, etc, and I can add this to the PR if needed.